package com.dxf.chepter02

/**
 *
 * for 循环控制
 * for 循环推导式 2中实现方式
 *
 *
 *
 */
object T20_循环控制 {
  def main(args: Array[String]): Unit = {
    //输出10句Hello Word

    val start = 1
    val end = 10
    //循环范围 [1-10]
    for (i <- start to end) {
      println("hello word" + i)
    }
    println("==============================================")

    //循环范围 [1-9]
    for (i <- start until end) {
      println("hello word" + i)
    }

    println("==============================================")
    var list = List("Hello", 10, 320, "tom")

    for (elem <- list) {
      println(elem)
    }


  }
}
